import request from '@/utils/request'

// 查询销售退货单列表
export function listSalesRefund(query) {
  return request({
    url: '/bill/salesRefund/list',
    method: 'get',
    params: query
  })
}

// 查询销售退货单详细
export function getSalesRefund(id) {
  return request({
    url: '/bill/salesRefund/' + id,
    method: 'get'
  })
}

// 新增销售退货单
export function addSalesRefund(data) {
  return request({
    url: '/bill/salesRefund',
    method: 'post',
    data: data
  })
}

// 修改销售退货单
export function updateSalesRefund(data) {
  return request({
    url: '/bill/salesRefund',
    method: 'put',
    data: data
  })
}

// 删除销售退货单
export function delSalesRefund(id) {
  return request({
    url: '/bill/salesRefund/' + id,
    method: 'delete'
  })
}

// 取消销售退货单
export function cancelSalesRefund(data) {
  return request({
    url: '/bill/salesRefund/cancel',
    method: 'put',
    data: data
  })
}

// 确认取消销售退货单
export function confirmCancelSalesRefund(data) {
  return request({
    url: '/bill/salesRefund/confirmCancel',
    method: 'put',
    data: data
  })
}

// 完成销售退货单
export function completeSalesRefund(data) {
  return request({
    url: '/bill/salesRefund/complete',
    method: 'put',
    data: data
  })
}

// 确认销售退货单
export function confirmSalesRefund(data) {
  return request({
    url: '/bill/salesRefund/confirm',
    method: 'put',
    data: data
  })
}




// 查询销售退货单明细列表
export function listSalesRefundDetail(query) {
  return request({
    url: '/bill/salesRefundDetail/list',
    method: 'get',
    params: query
  })
}

// 查询销售退货单明细详细
export function getSalesRefundDetail(id) {
  return request({
    url: '/bill/salesRefundDetail/' + id,
    method: 'get'
  })
}

// 新增销售退货单明细
export function addSalesRefundDetail(data) {
  return request({
    url: '/bill/salesRefundDetail',
    method: 'post',
    data: data
  })
}

// 修改销售退货单明细
export function updateSalesRefundDetail(data) {
  return request({
    url: '/bill/salesRefundDetail',
    method: 'put',
    data: data
  })
}

// 删除销售退货单明细
export function delSalesRefundDetail(id) {
  return request({
    url: '/bill/salesRefundDetail/' + id,
    method: 'delete'
  })
}
